﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="umu-sidemenu" style="display: inline;">
  <ul class="nav nav-stacked umu-sidebar" role="tablist">
  
 <c:forEach var="menu" items="${secure.submenus[activeMenu]}">
     <c:if test="${currentPrincipal.hasResource('submenus', menu.id)}"> 
		  <c:choose>
			<c:when test="${not empty menu.submenus}"> 
          <li class="presentation" role="presentation">
            <a href="javascript:void(0);" class="" ><span class="caret"></span>${menu.name}</a>
            <ul class="subnav list-unstyled">
            
              <c:forEach var="submenu" items="${menu.submenus}">
              
                 <c:if test="${currentPrincipal.hasResource('submenus', submenu.id)}"> 

                
                    <c:choose>
                      <c:when test="${not empty submenu.submenus}">
                        <li class="presentation" role="presentation">
                          <a href="javascript:void(0);" class="" ><span class="caret"></span>${submenu.name}</a>
                          <ul class="subnav list-unstyled">
                            <c:forEach var="ssmenu" items="${submenu.submenus}">
                              <li class="${menuContext.shouldHighlight(ssmenu.id) ? 'active' : ''}"><a href="${ctx.host}/${ssmenu.url}" title="${ssmenu.description}">${ssmenu.name}</a></li>
                            </c:forEach>                       
                          </ul>
                        </li>
                      </c:when>
                      <c:otherwise>
                        <li class="${menuContext.shouldHighlight(submenu.id) ? 'active' : ''}"><a href="${ctx.host}/${submenu.url}" title="${submenu.description}">${submenu.name}</a></li>  
                      </c:otherwise>
                    </c:choose>     
                

                </c:if> 

                          
              </c:forEach>
              
            </ul>
          </li>
		          </c:when>
		<c:otherwise>
			<li class="presentation" role="presentation">
				<ul class="nav nav-stacked umu-sidebar">
				<li class="${menuContext.shouldHighlight(menu.id) ? 'active' : ''}">
            		<a href="${ctx.host}/${menu.url}" class="" ></span>${menu.name}</a>	
            	</li>	
            	</ul>  
  			</li>
		</c:otherwise>
		</c:choose>     

     </c:if> 
    </c:forEach>   
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
    <!-- <li class="presentation" role="preparation">
      <a href="javascript:void(0);" class="" >${menu.name}目录一<span class="caret"></span></a>
      <ul class="subnav list-unstyled">
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
      </ul>
    </li>
    <li class="presentation" role="preparation">
      <a href="javascript:void(0);" class="" >${menu.name}目录二<span class="caret"></span></a>
      <ul class="subnav list-unstyled">
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
      </ul>
    </li>
    <li class="presentation" role="preparation">
      <a href="javascript:void(0);" class="" >${menu.name}目录三<span class="caret"></span></a>
      <ul class="subnav list-unstyled">
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
	      <li class="">
	        <a href="javascript:void(0);" >二级菜单</a>
	      </li>
      </ul>
    </li> -->
  </ul>
</div>

